package com.webchat.rmi.ugc.mall;


import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.mall.CreateProductPaymentOrderReqVO;
import com.webchat.domain.vo.request.mall.PreCreateProductOrderReqVO;
import com.webchat.domain.vo.response.mall.MallUserProductOrderResponseVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 声明用户对话消息基础服务 客户端
 */
@FeignClient(name = "webchat-ugc-service",
        contextId = "mallProductOrderClient",
        configuration = RpcRequestInterceptor.class)
public interface MallProductOrderClient {


    /**
     * 预创建商品订单
     *
     * @param preCreateProductOrderReq
     * @return
     */
    @PostMapping("/ugc-service/mall/product/order/preCreate")
    APIResponseBean<String> preCreateOrder(PreCreateProductOrderReqVO preCreateProductOrderReq);

    /**
     * 用户查询自己的订单
     *
     * @param userId
     * @param orderNo
     * @return
     */
    @GetMapping("/ugc-service/mall/product/order/detail/{userId}/{orderNo}")
    APIResponseBean<MallUserProductOrderResponseVO> userOrder(@PathVariable String userId, @PathVariable String orderNo);


    /**
     * 创建商品订单对应的支付订单
     *
     * @param createProductPaymentOrderReqVO
     * @return
     */
    @PostMapping("/ugc-service/mall/product/payment/createOrder")
    APIResponseBean<String> createPaymentOrder(@RequestBody CreateProductPaymentOrderReqVO createProductPaymentOrderReqVO);
}
